<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<portlet:defineObjects/>
<portlet:actionURL name="saveConfig" var="saveConfigURL"></portlet:actionURL>
<portlet:renderURL portletMode="edit" var="editURL"></portlet:renderURL>
<%
String isFromMenuList = (String)request.getAttribute("isFromMenuList");
%>
<form id="<portlet:namespace/>Form">
  <table width="90%" border="1">
<tr>
      <td width="120">来源菜单列表</td>
      <td>
        <input type="radio" name="isFromMenuList" id="isFromMenuListY" value="Y" />是&nbsp;&nbsp;
        <input type="radio" name="isFromMenuList" id="isFromMenuListN" value="N" />否</td>
    </tr>      
    <tr>
      <td width="120">菜单父节点ID</td>
      <td>
        <input name="parentMenuId" type="text" id="parentMenuId" value="${parentMenuId}" size="60" /></td>
    </tr>           
    <tr>
      <td width="120">数据URL</td>
      <td>
        <input name="dataURL" type="text" id="dataURL" value="${dataURL}" size="60" /></td>
    </tr>
    <tr>
      <td width="120">默认值</td>
      <td>
        <input name="defaultVariableValues" type="text" id="defaultVariableValues" value="${defaultVariableValues}" size="60" />      </td>
    </tr>
<tr>
      <td colspan="2" align="center">
        <input type="button" name="button" id="button" value="保存" onclick="submitAction('${saveConfigURL}',{formId:'<portlet:namespace/>Form'})" /> &nbsp;
        <input type="button" name="button2" id="button2" value="取消" onclick="fireAction('${editURL}')"/></td>
    </tr>
  </table>
</form>
<script language="javascript">
<%if ("Y".equals(isFromMenuList)){%>
	$('#<portlet:namespace/>Form #isFromMenuListY').attr("checked","checked");
<%}else{%>
	$('#<portlet:namespace/>Form #isFromMenuListN').attr("checked","checked");
<%}%>
$(document).ready(function(){
	var idParam = $('#<portlet:namespace/>Form #parentMenuId').val();
	var url = '/portal_portlets/resource?TitleObtain&actionType=getTitle&idParam=' + idParam + '&type=menu';
	sendRequest(url,{dataType:'text',onComplete:function(responseText){
		$('#<portlet:namespace/>Form #parentMenuId').qtip( 
		{ 
			content: {
				text: responseText			
			},
			style: {
				classes:'qtip-youtube'
			}
		});
	}});
});
</script>